<template>
	<view class="">
		<view class="pt-2 pb-3 adv-title" v-if="title">
			{{title}}
		</view>
		<view :class="del?'adv-img2':'adv-img'" v-if="cover">
			<image :src="cover" mode="" @click="emitDel"></image>
		</view>
		<slot></slot>
	</view>
</template>

<script>
	export default {
		name: "one-adv",
		data() {
			return {

			};
		},
		props: {
			title: {
				type: String
			},
			cover: {
				type: String
			},
			del: {
				type: Boolean
			}
		},
		methods: {
			emitDel() {
				this.$emit('emitDelStorage')
			}
		}
	}
</script>

<style scoped>
	.adv-img {
		width: 750rpx;
		height: 300rpx;
		position: relative;
		overflow: hidden;
	}

	.adv-img image {
		position: absolute;
		top: 50%;
		width: 100%;
		transform: translateY(-50%);
	}

	.adv-img2 {
		position: relative;
	}

	.adv-img2 image {
		width: 30rpx;
		height: 38rpx;
		position: absolute;
		top: -65rpx;
		right: 20rpx;
	}

	.adv-title {
		font-size: 32rpx;

	}
</style>